package cn.mst.vrs.convert;

import cn.mst.vrs.controller.admin.order.vo.OrderRespVO;
import cn.mst.vrs.controller.app.order.vo.ReservationOrderRespVO;
import cn.mst.vrs.dal.dataobject.order.OrderDO;
import cn.mst.vrs.dal.dataobject.venue.VenueDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.time.LocalDateTime;

@Mapper
public interface OrderConvert {
    OrderConvert INSTANCE = Mappers.getMapper(OrderConvert.class);

    @Mapping(target = "id", source = "order.id")
    @Mapping(target = "venueId", source = "order.itemId")
    @Mapping(target = "venueCode", source = "venueDO.code")
    @Mapping(target = "venueName", source = "venueDO.name")
    @Mapping(target = "status", source = "order.status")
    ReservationOrderRespVO toReservationOrderRespVO(OrderDO order, VenueDO venueDO, LocalDateTime startedAt, LocalDateTime endedAt);

    OrderRespVO toRespVO(OrderDO order, String type, String nickName, String itemName);
}
